/**
 * @Author: 张兴
 * @Date: 2019/6/20
 * @Last Modified by:   张兴
 * @Last Modified time: 2019-09-12 15:45:00
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';
// 查询
export const getUsedCarAccount = params =>
  axios.get(`${SERVER.AUDI_USEDCAR}/sales/saleOrder/search`, {
    params
  });
// 首页查询  全部状态
export const searchByPage = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder`, {
    params
  });
// 首页查询  全部状态 不分页
export const searchNoPage = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/noPage`, {
    params
  });
// 首页查询  未上传状态
export const searchByPageWSC = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/searchByPageWSCNoPage`, {
    params
  });
// 首页查询  已上传状态
export const searchByPageYSC = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/searchByPageYSCNoPage`, {
    params
  });
// 新增
export const addUsedCarAccount = params => axios.post(`${SERVER.AUDI_USEDCAR}/collector/insert`, params);
// 删除
export const deleteUsedCarAccount = params =>
  axios.delete(`${SERVER.AUDI_USEDCAR}/collector/batchDelete`, {
    params
  });
// 抽屉业 查询列表 主要表：销售结算车辆表：TT_UC_SALE_SETTLE_VHL
export const getUsedCarSaleSettlePanel = params =>
  axios.get(`${SERVER.AUDI_USEDCAR}/sales/saleSettleVhl/search`, {
    params
  });

// 查询 委托书
export const selectWTS = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectWTS`, {
    params
  });
// 索赔件管理  点击  维护索赔单
export const selectWH = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectWH`, {
    params
  });
// 查询 车辆信息反馈单号
export const selectCLXXFKDH = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectCLXXFKDH`, {
    params
  });

// 查询 引导数据
export const selectYDSJ = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectYDSJ`, {
    params
  });

// 查询 购买备件时委托书
export const selectGMBJWTS = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/repair/claim/getBjRoNo`, { params });
// export const selectGMBJWTS = params =>
//   axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectGMBJWTS`, {
//     params
//   });

// 查询购买备件时委托书的损坏件
export const queryRepairPart = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/repair/claim/queryRepairPart`, { params });

// 查询 故障代码
export const selectGZDM = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectGZDM`, {
    params
  });

// 查询 故障类别
export const selectGZLB = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectGZLB`, {
    params
  });

// 查询 故障位置
export const selectGZWZ = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectGZWZ`, {
    params
  });

// 查询 弹出框 标准工件
export const selectBZGJ = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectBZGJ`, {
    params
  });

// 查询 弹出框 特殊材料
export const SelectTSCL = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/SelectTSCL`, {
    params
  });

// 查询 弹出框 标准材料（全部状态）
export const SelectBJCL = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/SelectBJCL`, {
    params
  });
// 查询 弹出框 标准材料（未形成索赔单状态）
export const SelectBJCLWxc = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/SelectBJCLWxc`, {
    params
  });
// 查询 弹出框 标准材料（已形成索赔单状态）
export const SelectBJCLYxc = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/SelectBJCLYxc`, {
    params
  });

// 查询 弹出框 外委工位
export const SelectWWGW = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/SelectWWGW`, {
    params
  });

// 查询 索赔类别
export const getSelectSPLB = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getSelectSPLB`, {
    params
  });

// 查询 车辆类别
export const getSelectCLLB = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getSelectCLLB`, {
    params
  });
// 查询 TPI代码  和  行动ID
export const selectTPI = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectTPI`, {
    params
  });
// 查询 申请单号
export const getSQDH = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getSQDH`, {
    params
  });
// 查询 索赔结果 表单
export const getDateSpjg = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getDateSpjg`, {
    params
  });
// 查询 索赔结果 列表
export const getListSpjg = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getListSpjg`, {
    params
  });
// 查询 故障代码 和 车系 是否在 bzd关系表中
export const ifExists = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/ifExists`, {
    params
  });

// 点击编辑回显数据前， 调feign接口查询当前条信息 字段不在索赔单里的字段
export const getQT = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getQT`, {
    params
  });

// 保存 判断申请单号是否重复
export const getisCF = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/isCF`, {
    params
  });
// 委托书编号G-
export const getG = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/selectGXM`, {
    params
  });

// 抽屉业  保存
export const saveOrUpdate = params => axios.put(`${SERVER.AUDI_CLAIM}/claim/claimOrder/saveOrUpdate`, params);

// 详情 获取项目
export const getXmInfo = (id, params) =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getClaimLabours/${id}`, {
    params
  });

// 详情 获取配件
export const getBjInfo = (id, params) =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getClaimParts/${id}`, {
    params
  });
// 主页面删除
export const deleteZ = (id, params) =>
  // wjf 2020年1月20日 delete改成post
  axios.post(`${SERVER.AUDI_CLAIM}/claim/claimOrder/${id}`, {
    params
  });
// 上传索赔单
export const upload = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/upload`, {
    params
  });

// 编辑时，删除备件
export const deleteBj = params => axios.put(`${SERVER.AUDI_CLAIM}/claim/claimOrder/deleteBj`, params);
// 同一底盘号，同一送修日期，相同故障代码，不同故障位置申报，规则是不论此车有几张委托书，满足上述条件时，索赔工位只能申报在一张索赔单中
export const checkCF = params => axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/checkCF`, { params });
// 关联申请单  逻辑
export const checkCFGl = params => axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/checkCFGl`, { params });

// 车系
export const getClaimSeries = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/baseData/basicData/claimSeries`, {
    params
  });

// queryfeedback 查询反馈单号
export const queryfeedback = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repair/queryfeedback`, { params });
// 上传行动信息
export const moveInfoUpload = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/order/repair/moveInfoUpload`, params);
// 查询 索赔类别
export const getClaim = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/query`, {
    params
  });
// 更新车辆档案
export const updateVehicleUse = params => axios.put(`${SERVER.DMSCLOUD_REPAIR}/repair/queryQueeryOwnerInformation/updateVehicleUse/${params}`);

export const getClaimType = factoryCode => axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getClaimType/${factoryCode}`);

// 获取登录人账号
export const getportal = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/portal/getPortal`, { params });

// 保存时，在服务里判断该工单是否有备件出库（看该工单里有没有备件）
export const pdck = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/repair/claim/pdck`, { params });
// 选择完工单后，自动查询fd
export const getFD = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/repair/claim/getFD`, { params });
// 保存时，判断故障代码，类别，位置
export const jygxbp = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/jygxb`, {
    params
  });
// 校验故障代码
export const jyGzdm = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/administration/partIn/jyGzdm`, {
    params
  });

// 点击关闭按钮，删除没用的单号
export const delVbillno = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/delVbillno`, {
    params
  });
// 选择委托书后，带出工位，判断工位是否是特殊工位，如果是，特殊工位标识对号
export const getTS = params =>
  axios.get(`${SERVER.AUDI_CLAIM}/claim/claimOrder/getTS`, {
    params
  });
